From 2dac0016202632c10195795a5c84908f1de976dc Mon Sep 17 00:00:00 2001 From: robertl Date: Sun, 1 Feb 2004 05:07:58 +0000 Subject: [PATCH] Retain "htmlness" on cache description reads to that readers can spit them back out. --- gpsbabel/defs.h | 12 ++++++++---- gpsbabel/gpx.c | 6 ++++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/gpsbabel/defs.h b/gpsbabel/defs.h index 46a13ed55..5bd68dae4 100644 --- a/gpsbabel/defs.h +++ b/gpsbabel/defs.h @@ -95,6 +95,11 @@ typedef enum { gc_virtual } geocache_container; +typedef struct { + int is_html; + char *utfstring; +} utf_string; + typedef struct { geocache_type type; geocache_container container; @@ -102,12 +107,10 @@ typedef struct { int terr; /* (likewise) */ time_t exported; char *hint; /* all these UTF8, XML entities removed, May be not HTML. */ - char *desc_short; - char *desc_long; + utf_string desc_short; + utf_string desc_long; } geocache_data ; - - typedef struct xml_tag { char *tagname; char *cdata; @@ -391,6 +394,7 @@ void rtrim(char *s); signed int get_tz_offset(void); const char *get_cache_icon(const waypoint *waypointp); char * xml_entitize(const char * str); +char * strip_html(const utf_string*); char * str_utf8_to_cp1252( const char * str ); char * str_utf8_to_ascii( const char * str ); diff --git a/gpsbabel/gpx.c b/gpsbabel/gpx.c index 627e51b9a..694b2ead7 100644 --- a/gpsbabel/gpx.c +++ b/gpsbabel/gpx.c @@ -610,13 +610,15 @@ gpx_end(void *data, const char *el) case tt_cache_desc_long: rtrim(cdatastrp); if (cdatastrp[0]) { - wpt_tmp->gc_data.desc_long = xstrdup(cdatastrp); + wpt_tmp->gc_data.desc_long.is_html = cache_descr_is_html; + wpt_tmp->gc_data.desc_long.utfstring = xstrdup(cdatastrp); } break; case tt_cache_desc_short: rtrim(cdatastrp); if (cdatastrp[0]) { - wpt_tmp->gc_data.desc_short = xstrdup(cdatastrp); + wpt_tmp->gc_data.desc_short.is_html = cache_descr_is_html; + wpt_tmp->gc_data.desc_short.utfstring = xstrdup(cdatastrp); } break; case tt_cache_terrain: -- 2.30.2